package whiledemo;

import java.sql.SQLOutput;
import java.util.Scanner;

/**
 * break
 * continue
 * return
 */
public class whiledemo4 {
    public static void main(String[] args) {
        while (true){
            System.out.println("学生录入系统");
            System.out.println(" 1.录入 2.停止");
            Scanner s = new Scanner(System.in);
            int i = s.nextInt();
            if (i == 1){
                System.out.println("请输入姓名");
                String name = s.next();
                System.out.println("姓名是："+name);
            }else if (i == 2){
                System.out.println("请输入正确的数字编号");
                //continue;//退出本次循环，进入下次循环
                break;
            }
            System.out.println("录入结束");
            return;
        }
    }
}
